package com.zxy.supplier_system.server.controller

import com.zxy.supplier_system.server.service.MarketSaleDocumentService
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import java.time.YearMonth

@RestController
@RequestMapping("/markets/{marketId}/accounts/saleDocuments")
class MarketsAccountSaleDocumentController(
    private val marketSaleDocumentService: MarketSaleDocumentService,
) {

    @GetMapping("existedYearMonth")
    fun existedYearMonth(@PathVariable marketId: Int):List<YearMonth>{
        return marketSaleDocumentService.findDistinctYearMonthObjectByMarketId(marketId)
    }

}